<header>
  <div class="container">
    <div class="clearfix">
      <h1 class="f24 left pa-top-3">
        <a href="/">
          <%= image_tag 'logo.jpg' %>
        </a>
      </h1>
      <div class="right">
        <ul class="topbar clearfix pa-top-2">
          <% if user_signed_in? %>
            <li class="pa-right-0"><%= link_to "退出", destroy_user_session_path, :method => :delete %></li>
            <li>
              <%= link_to '代金券', "/users/vouchers" %>
              (<%= current_user.vouchers.count %>)
            </li>
            <li>
              <%= link_to '购物车', "/carts/show" %>
              (<%= current_user.carts.count %>)
            </li>
            <li><%= link_to '个人中心', "/users/show" %></li>
            <li class="bold no-border"><%= current_user.name(nil)||current_user.email %></li>
          <% elsif admin_signed_in? %>
            <li class="pa-right-0"><%= link_to "退出", destroy_admin_session_path, :method => :delete %></li>
            <li><%= link_to "后台管理", '/admins' %></li>
            <li class="bold no-border"><%= current_admin.email %></li>
          <% else %>
            <li class="pa-right-0"><%= link_to "新用户注册", '/users/sign_up' %></li>
            <li class="no-border"><%= link_to "登录", '/users/sign_in' %></li>
          <% end %>
        </ul>
        <nav class="pa-top f14 text-right">
          <%= link_to "首页", '/home' %>
          <%= link_to "我要订餐", '/products' %>
          <%= link_to "博客", '/blog' %>
          <%= link_to "在线留言", '/feedbacks', :class => 'pa-right-0' %>
        </nav>
      </div>
    </div>
  </div>
</header>